home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
gametp20.zip
/
IMAGING.INT
< prev
next >
Wrap
Text File
|
1992-11-05
|
3KB
|
87 lines
Unit Imaging;
{ Imaging version 1.1 Copyright (C) 1992 Scott D. Ramsay }
{ ramsays@access.digex.com }
{ This unit is specifically for Mode 13h (320x200x256). It is a }
{ lot faster than using the BGI drivers (VGA256.BGI). Majority of }
{ the code is written using BASM. This will work on 286 machines or }
{ higher. "I don't know about the P5 chip though." ;) }
{ IMAGING.TPU can be used freely in commerical and non-commerical }
{ programs. As long as you don't give yourself credit for writing }
{ this portion of the code. When distributing it (free only), please }
{ include all files and samples so others may enjoy using the code. }
{ Enjoy. }
{ }
{ Changes from 1.0: }
{ Added function to load gif files. (slow, it my first attempt) }
Interface
Uses VgaKern;
type
VidHdrType = record
position,count : word; { header block for PTR files }
end;
var
rgb256 : RGBlist; { palette of last loaded PCX file }
function loadpcx(pfilename:string):integer;
function loadgif(gfilename:string):integer;
procedure DrawPtr(var p;merge:boolean;sz:longint);
function LoadPTR(fn:string;merge:boolean):integer;
function SavePTR(fn:string):integer;
Implementation
(***********************************************************************)
function loadpcx(pfilename:string):integer;
loads a PCX file from disk to the current page. Returns 0 if no error,
Make sure its a 320x200 image.
(***********************************************************************)
function loadgif(gfilename:string):integer;
loads a GIF file from disk to the current page. Returns 0 if no error,
Make sure its a 320x200 image. This procedure is very slow.
(***********************************************************************)
procedure DrawPtr(var p;merge:boolean;sz:longint);
loads a PTR file from memory to the current page
p : is the PTR location,
merge : set to true to overlay image
sz : size of PTR file
(***********************************************************************)
function LoadPTR(fn:string;merge:boolean):integer;
loads a PTR file from disk to the current page, returns
0 if no error
(***********************************************************************)
function SavePTR(fn:string):integer;
save the current page as a PTR file, returns 0 if no error
(***********************************************************************)
If you have any problems, e-mail at:
ramsays@access.digex.com
Sorry, I don't have permanent snail-mail address yet. I just moved
to the Washington DC area.
The TPU units can be used with in your programs. With out giving
me credit. If you want the source code, more samples or swap-talk,
just e-mail me. I'll give sample use-code for free. Actual TPU-source
code prices can be discussed.
Scott D. Ramsay